﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace HRM.Model
{
    public class Entity : INotifyPropertyChanged
    {
        private bool _isChecked = false;

        public bool IsChecked
        {
            get { return _isChecked; }
            set
            {
                if (_isChecked != value)
                {
                    _isChecked = value;
                    OnPropertyChanged("IsChecked");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }

    public partial class DMChungChi : Entity { }

    public partial class ChucVu : Entity { }

    public partial class TrinhDoHocVan : Entity { }

    public partial class LoaiLuongThuong : Entity { }

    public partial class NhanVien : Entity
    {
        public ImageSource AvatarSource
        {
            get
            {
                if (AnhDaiDien == null)
                {
                    return new BitmapImage(new Uri("/Assets/Images/man.png", UriKind.Relative));
                }
                string serverIP = Properties.Settings.Default.ServerIP;
                return new BitmapImage(new Uri(serverIP + this.AnhDaiDien, UriKind.Absolute));
            }
        }
    }

    public partial class LuongThuong : Entity { }

    public partial class ThamGiaDuAn : Entity { }

    public partial class ChungChi : Entity { }

    public partial class ThoiViec : Entity { }

    public partial class QuaTrinhCongTac : Entity { }

    public partial class NguoiSuDung : Entity { }

    public partial class NhomNguoiDung : Entity { }

    public partial class PhanQuyen : Entity { }

    public partial class ChucNang : Entity { }

    public partial class BangLuong : Entity { }

    public partial class KinhNghiem : Entity { }
}
